home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / pctj8506.arc / WCA.C < prev   
Text File  |  1986-09-14  |  1KB  |  30 lines

  1. /* wca.c - write char and string with attr.- Blaise Ctools */
  2. #include "stdio.h"
  3. #include "screen.h"
  4.  
  5. int wca(c,a)            /* write char and attribute */
  6.  int c ;            /* char to write */
  7.  int a ;            /* attribute to write */
  8.  {
  9.    switch( c )
  10.      {                /* check for control chars */
  11.      case '\r' : case '\n' : case 0x07 : case 0x08 :
  12.        break ;
  13.      default :
  14.        scattrib(a,0,c,1) ;    /* Ctools function writes */
  15.        break ;            /* char and attr. to screen */
  16.      }                /* does not advance cursor */
  17.    scttywrt(c,0) ;        /* Ctools function to write */
  18.  }                /* char only and move cursor */
  19.  
  20.  
  21. int wsa(s,a)            /* write string with attribute */
  22.  char *s ;            /* string pointer */
  23.  int a ;            /* attribute */
  24.  {
  25.     while( *s != '\0' )        /* repeat until end of string */
  26.       { wca(*s,a) ;        /*    use wca to write next char */
  27.         s = s + 1 ;        /*    advance pointer */
  28.       }
  29.  }
  30.